package cn.client.data.remoteData.repository

import cn.client.data.remoteData.ApiService
import cn.client.data.remoteData.bean.AddMindfulnessLogBody
import cn.client.data.remoteData.bean.BaseResp
import cn.client.data.remoteData.bean.BuildGroupApply
import cn.client.data.remoteData.bean.EvaluateItem
import cn.client.data.remoteData.bean.GetEvaluate
import cn.client.data.remoteData.bean.InsertEvaluate
import cn.client.data.remoteData.bean.JoinGroup
import cn.client.data.remoteData.bean.MindfulnessGroup
import cn.client.data.remoteData.bean.MindfulnessLog
import cn.client.data.remoteData.bean.MindfulnessMedia
import cn.client.data.remoteData.bean.MindfulnessRequestWithUid
import cn.client.data.remoteData.bean.PageSelect
import cn.client.data.remoteData.bean.PageSelectByMid
import cn.client.data.remoteData.bean.PageSelectByUid
import cn.client.data.remoteData.bean.SelectUidAndMid
import javax.inject.Inject

class MindfulnessRepository @Inject constructor(private val apiService: ApiService) {

    // 获取正念资源列表
    suspend fun getMediaList(pageSelect: PageSelect) : BaseResp<List<MindfulnessMedia>> {
        return apiService.getMediaList(pageSelect)
    }
    // 根据用户id获取正念资源列表
    suspend fun getMediaListByUid(pageSelectByUid: PageSelectByUid): BaseResp<List<MindfulnessMedia>>  {
        return apiService.getMediaListByUid(pageSelectByUid)
    }

    // 获取正念信息
    suspend fun getMediaInfo(selectUidAndMid: SelectUidAndMid) : BaseResp<MindfulnessMedia> {
        return apiService.getMediaInfo(selectUidAndMid)
    }

    // 获取正念团体列表
    suspend fun getGroupList(pageSelect: PageSelect) : BaseResp<List<MindfulnessGroup>> {
        return apiService.getGroupList(pageSelect)
    }

    // 收藏正念
    suspend fun collectMindfulness(midAndUid: MindfulnessRequestWithUid): BaseResp<String>{
        return apiService.collectMindfulness(midAndUid)
    }
    // 取消收藏正念
    suspend fun unCollectMindfulness(unCollect: MindfulnessRequestWithUid): BaseResp<String> {
        return apiService.unCollectMindfulness(unCollect)
    }

    // 查看收藏
    suspend fun selectCollectMindfulness(uid: Int): BaseResp<List<MindfulnessMedia>> {
        return apiService.selectCollectMindfulness(uid)
    }

    // 新增正念评分
    suspend fun addEvaluateInMindfulness(insertEvaluate: InsertEvaluate): BaseResp<Any> {
        return apiService.addEvaluateInMindfulness(insertEvaluate)
    }
    // 修改正念评分
    suspend fun updateEvaluateInMindfulness(updateEvaluate: InsertEvaluate): BaseResp<Any> {
        return apiService.updateEvaluateInMindfulness(updateEvaluate)
    }

    // 查看评分信息
    suspend fun getEvaluateInfo(selectUidAndMid: SelectUidAndMid): BaseResp<GetEvaluate> {
        return apiService.getEvaluateInfo(selectUidAndMid)
    }

    // 查看评分列表
    suspend fun getEvaluateInMindfulness(pageSelectByMid: PageSelectByMid): BaseResp<List<EvaluateItem>> {
        return apiService.getEvaluateInMindfulness(pageSelectByMid)
    }

    // 正念打卡
    suspend fun addMindfulnessLog(add : AddMindfulnessLogBody): BaseResp<String> {
        return apiService.addMindfulnessLog(add)
    }

    // 查看打卡列表
    suspend fun getMindfulnessLogList(pageSelect: PageSelectByUid): BaseResp<List<MindfulnessLog>> {
        return apiService.getMindfulnessLogList(pageSelect)
    }

    // 正念团体创建申请
    suspend fun buildGroup(groupApply: BuildGroupApply): BaseResp<String> {
        return apiService.buildGroup(groupApply)
    }

    // 查看已加入的团体
    suspend fun getJoinGroupList(pageSelect: PageSelectByUid): BaseResp<List<JoinGroup>> {
        return apiService.getJoinGroupList(pageSelect)
    }


    



}